<?php 
include ("../../checkuser.php"); 
include "include/kopf.php";
include "include/menu.php";
include "../../conf.php";

//Globale Variabeln definieren
$bid=$_SESSION["user_id"];
 $terminan = isset($_GET['terminan']) ? $_GET['terminan'] : "";
 $terminaus = isset($_GET['terminaus']) ? $_GET['terminaus'] : "";
 $notizan = isset($_GET['notizan']) ? $_GET['notizan'] : "";
 $notizaus = isset($_GET['notizaus']) ? $_GET['notizaus'] : "";
// Termin auf/zu klappen
if($terminan) mysql_query("UPDATE benutzerdaten SET `termin`='1' WHERE `Id`='$bid'",$connect);
if($terminaus) mysql_query("UPDATE benutzerdaten SET `termin`='0' WHERE `Id`='$bid'",$connect);
// Notizen auf/zu klappen
if($notizan) mysql_query("UPDATE benutzerdaten SET `notiz`='1' WHERE `id`='$bid'",$connect);
if($notizaus) mysql_query("UPDATE benutzerdaten SET `notiz`='0' WHERE `id`='$bid'",$connect);


//Alle Variabel l&ouml;schen
$aus = isset($_GET['aus']) ? $_GET['aus'] : "";
if ($aus=1)
{
unset($GLOBALS);
}

// Funktion zum schlie&szlig;en aller Variabeln/bzw. Fenster
function aus()
{
    echo "<div style='float: right'>[ "; echo "<a href='".$_SERVER['PHP_SELF']."?aus=1'>Ansicht Schlie&szlig;en</a>";echo " ]</div>";
}
// Termin und Notiz Schalter auslesen

$result = mysql_query("SELECT * FROM benutzerdaten where Id=$bid",$connect);
while($benutzer=mysql_fetch_array($result))
{
$visuell=$benutzer['visuell'];
$notizschalter=$benutzer['notiz'];
$terminschalter=$benutzer['termin'];
}

if ($visuell==1)
{

?>
<!-- Tiny MCE Anfang -->
<script type="text/javascript" src="../../tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
	mode : "textareas",
	theme : "simple"
});
</script>
<!-- Tiny ENDE -->
<?php } ?>


<!-- Kalenderscript ANfang -->
<link rel="stylesheet" href="scripts/dynCalendar.css" type="text/css" media="screen">
	<script src="scripts/browserSniffer.js" type="text/javascript" language="javascript"></script>
	<script src="scripts/dynCalendar.js" type="text/javascript" language="javascript"></script>
	<script type="text/javascript">
	<!--
		// Calendar callback. When a date is clicked on the calendar
		// this function is called so you can do as you want with it
		function calendarCallback(datum, month, year)
		{
      datum = year + '-' + month + '-' + datum;
			document.forms[0].datum.value = datum;
		}
	// -->
	</script>
<td valign="top">
<table>
<tr><td style="border-right: dashed 1px; " valign="top">
<?php
// Ausgabe des Menus
include "../../conf.php";
$resultmenu = mysql_query("SELECT * FROM seitengenerator ORDER BY reihe ASC",$connect);
while($table=mysql_fetch_array($resultmenu))
{

if ($table['template']=='1') // Wenn Template
{
$template=$table['inhalt'];
include "../../seitentemplates/$template"; //echo "<br>";
}
else
{
echo "<b>"; echo $table['inhalt']; echo "</b><br>"; 
}
}
?>  
</table></td>